x86/mm: Take care of domain reference for shared pages
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>
Thu, 5 Apr 2012 10:06:03 +0000 (11:06 +0100)
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>
Thu, 5 Apr 2012 10:06:03 +0000 (11:06 +0100)
commit1f348a695fa0a22ee1e99c8972181de859ec3d87
tree4e55d33b042f3e1047b5bf09dad3a8f953f9becc
parentcf705ff84bf2c911dfca2a3f3aeb130d110701bf
x86/mm: Take care of domain reference for shared pages

Making a page sharable removes it from the previous owner's list. Making it
private adds it. These actions are similar to freeing or allocating a page.
Except that they were not minding the domain reference that is taken/dropped
when the first/last page is allocated/freed.

Without fixing this, a domain might remain zombie when destroyed if all its
pages are shared.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/mem_sharing.c